package com.zxl.designpattern.structure.flyweight;


/**
 * @author zxl
 * @description 享元模式-非享元-文档，使用享元对象
 * @date 2024/1/15
 */
public class Document {
    private StringBuilder content = new StringBuilder();

    public void addFormattedText(String text, TextFormat format) {
        content.append(text);
        format.applyFormat(text);
    }

    public String getContent() {
        return content.toString();
    }
}